# Code from http://thomasfischer.biz/?p=351

cmake_minimum_required(VERSION 2.6)

project(OIS)

FILE(GLOB OIS_SRCS src/*.cpp)
FILE(GLOB_RECURSE OIS_SRCS_WINDOWS src/win32/*.cpp)
FILE(GLOB_RECURSE OIS_SRCS_LINUX src/linux/*.cpp)
FILE(GLOB_RECURSE OIS_SRCS_MAC src/mac/*.cpp)

# general flags
add_definitions("-D_LIB -D_CRT_SECURE_NO_WARNINGS")
include_directories (includes)

# platform
IF(WIN32)
  add_library(ois STATIC ${OIS_SRCS} ${OIS_SRCS_WINDOWS})
  target_link_libraries(ois dxguid.lib dinput8.lib)
ELSEIF(UNIX)
  add_library(ois STATIC ${OIS_SRCS} ${OIS_SRCS_LINUX})
ELSEIF(APPLE)
  add_library(ois STATIC ${OIS_SRCS} ${OIS_SRCS_MAC})
ENDIF(WIN32)
